package com.banciyuan.bcywebview.base.helper.push;

import com.banciyuan.bcywebview.base.helper.push.Item.BasePush;
import com.banciyuan.bcywebview.base.helper.push.Item.PushError;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemEight;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemFifth;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemFirst;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemForth;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemNinth;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemSecond;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemSeventh;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemSixth;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemTen;
import com.banciyuan.bcywebview.base.helper.push.Item.PushItemThrid;

/**
 * Created by squall on 2015/9/18.
 */
public class PushFactory {

    public static String[] msgs;

    public static BasePush getPush(String msg) {

        try {
            msgs = msg.split("#");
            String firstNum = msgs[0];
            if (firstNum.equals("0")) {
                return new PushItemFirst();
            } else if (firstNum.equals("1")) {
                return new PushItemSecond();
            } else if (firstNum.equals("2")) {
                return new PushItemThrid();
            } else if (firstNum.equals("3")) {
                return new PushItemForth();
            } else if (firstNum.equals("4")) {
                return new PushItemFifth();
            } else if (firstNum.equals("5")) {
                return new PushItemSixth();
            } else if (firstNum.equals("6")) {
                return new PushItemSeventh();
            } else if (firstNum.equals("7")) {
                return new PushItemEight();
            } else if (firstNum.equals("8")) {
                return new PushItemNinth();
            } else if (firstNum.equals("9")) {
                return new PushItemTen();
            } else {
                return new PushError();
            }
        } catch (Exception e) {
            e.printStackTrace();
            return new PushError();
        }
    }

}
